home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1986 July & August / rerun-1986-07-08.d64 / menu subroutine (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  64 lines

  1. 102 rem   *****************************
  2. 104 rem   *                           *
  3. 106 rem   *      menu subroutine      *
  4. 108 rem   *   demonstration program   *
  5. 112 rem   *                           *
  6. 114 rem   *****************************
  7. 116 rem
  8. 118 rem   reserve p$, poke machine language
  9. 120 p$="" : c=0 : for i=50176 to 50323 : read j : poke i,j : c=c+j : next
  10. 130 if c <> 17444 then print "error in data statements!" : end
  11. 132 rem
  12. 134 rem  set k$ array to represent
  13. 136 rem  character color choices
  14. 138 k$(1)=chr$(144) : k$(2)=chr$(5) : k$(3)=chr$(28) : k$(4)=chr$(159)
  15. 142 k$(5)=chr$(156) : k$(6)=chr$(30) : k$(7)=chr$(31) : k$(8)=chr$(158)
  16. 144 rem
  17. 146 rem  set pn and variable for border
  18. 148 rem  color choice menu
  19. 149 pn=15 : p$="^black^white^red^cyan^purple^green^blue^yellow^orange"
  20. 151 p$=p$ + "^brown^light red^dark gray^light gray^light green^light blue"
  21. 152 print"[147]"
  22. 153 print"   what color should the border be?" : print : gosub500 :poke53280,p-1
  23. 154 rem
  24. 156 rem  now do the background
  25. 158 print"[147]"
  26. 162 print" what color should the background be?" : print :gosub500:poke53281,p-1
  27. 164 print"[147]"
  28. 166 rem
  29. 168 rem  use a different menu with less
  30. 172 rem  choices for character color
  31. 174 p$="^black^white^red^cyan^purple^green^blue"
  32. 176 print" what color should the characters be?":print:gosub500:printk$(p):end
  33. 476 rem
  34. 478 rem
  35. 482 rem    ****************************
  36. 484 rem    *                          *
  37. 486 rem    *      menu subroutine     *
  38. 488 rem    *                          *
  39. 492 rem    ****************************
  40. 494 rem
  41. 496 rem  set up and jump to machine
  42. 498 rem  language routine to print menu
  43. 500 poke50179,pn : sys50176 : ph=peek(50180)
  44. 502 rem  language routine to print menu
  45. 512 rem
  46. 514 rem  now input a choice
  47. 520 print:print""tab(15)"choice           [157][157][157][157][157][157][157][157][157][157][157]"; : inputpt$ :p=val(pt$)
  48. 530 ifp>0 and p<=ph then return
  49. 540 print"     choose a value between 1 and"ph"[145][145][145][145][145][145][145]" : goto520
  50. 586 rem
  51. 588 rem
  52. 592 rem  these are the data statements
  53. 594 rem  representing the machine
  54. 596 rem  language routine that prints
  55. 598 rem  the menu
  56. 600 data 76,8,196,0,0,0,0,0,160,2,177,45,141,5,196,200,177,45,133,251,200,177
  57. 610 data 45,133,252,169,0,141,4,196,169,48,141,6,196,141,7,196,160,0,177,251
  58. 620 data 201,94,208,84,169,13,32,210,255,174,3,196,138,201,0,240,9,169,32,32
  59. 630 data 210,255,202,76,54,196,173,4,196,24,105,1,141,4,196,173,6,196,201,48
  60. 640 data 208,2,169,32,32,210,255,173,7,196,201,56,208,9,173,6,196,24,105,1,141
  61. 650 data 6,196,173,7,196,201,57,208,2,169,47,24,105,1,32,210,255,141,7,196,169
  62. 660 data 41,32,210,255,169,32,32,210,255,200,173,5,196,56,233,1,141,5,196,201
  63. 670 data 0,208,149,96
  64.